﻿namespace TNPTN.Services
{
    /// <summary>
    /// Database Service
    /// Author: jabraok
    /// </summary>
    public class DbServices
    {
        /// <summary>
        /// Connect String
        /// </summary>
        public static string ConnectionString 
        { 
            get
            {
                return System.Configuration.ConfigurationManager.ConnectionStrings["TNPTNConnectionString"].ConnectionString;
            }
        }

        /// <summary>
        /// Create new context
        /// </summary>
        /// <returns>Data Context</returns>
        public static DB.TNPTNDataContext CreateContext()
        {
            return new DB.TNPTNDataContext(ConnectionString);
        }        
    }
}